package com.heima.wemedia.client;
/*
    
 需求描述：
 @Author: wang
 @Date: 2022/10/21 17:10
 
 */

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmSensitiveDto;
import com.heima.model.wemedia.dtos.WmSensitivePageReqDto;
import com.heima.wemedia.service.WmSensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/sensitive")
public class SensitiveClient {

    @Autowired
    private WmSensitiveService sensitiveService;

    /**
     * 敏感词保存
     * @param dto
     * @return
     */
    @PostMapping("/save")
    public ResponseResult save(@RequestBody WmSensitiveDto dto){
        return sensitiveService.saveSensitive(dto);
    }

    @PostMapping("/list")
    public ResponseResult listSensitive(@RequestBody WmSensitivePageReqDto dto){
        return sensitiveService.listSensitive(dto);
    }

    @PostMapping("/update")
    public ResponseResult updateSensitive(@RequestBody WmSensitiveDto dto){
        return sensitiveService.updateSensitive(dto);
    }

    @DeleteMapping("/del/{id}")
    ResponseResult deleteSensitive(@PathVariable Integer id){
        return sensitiveService.deleteSensitive(id);
    }
}

